<template>
	<image :src="avatar" lazy-load mode="aspectFill" :style="{width:size+'rpx',height:size+'rpx'}" class="user-avatar"></image>
</template>

<script>
	import DefaultAvatar from '@/static/default-avatar.png'
	export default{
		props:{
			src:'',
			size:{
				type:[String,Number],
				default:80
			}
		},
		computed:{
			avatar(){
				return this.src||DefaultAvatar
			}
		},
		data(){
			return{
				DefaultAvatar
			}
		}
	}
</script>

<style lang="scss" scoped>
	.user-avatar{
		display: block;
		border-radius: 100%;
	}
</style>
